package work;

public class ArrDemo {
    public static void main(String[] args) {
        int[] arr1 = new int[3]; //0,0,0
        int[] arr3 = new int[]{2,5,8}; //2,5,8
        int[] arr2 = {2,5,8}; //2,5,8
        int[] arr4;
        arr4 = new int[3];
        System.out.println(arr4[0]);
        System.out.println(arr4[1]);
        //arr4 = {2,5,8}; //编译错误，此方式只能声明同时初始化
        arr4 = new int[]{2,5,8}; //正确
        System.out.println(arr4[0]);
        System.out.println(arr4[1]);

    }
}
